﻿using GalaSoft.MvvmLight;

namespace TransControlSystem.Model
{
    public class User : ObservableObject
    {
        /// <summary>
        /// 主键
        /// </summary>
        private int _Id;
        /// <summary>
        /// 主键
        /// </summary>
        public int Id
        {
            get { return _Id; }
            set
            {
                _Id = value;
                RaisePropertyChanged(() => Id);
            }
        }
        /// <summary>
        /// 账号
        /// </summary>
        private string _Account;
        /// <summary>
        /// 账号
        /// </summary>
        public string Account
        {
            get { return _Account; }
            set
            {
                _Account = value;
                RaisePropertyChanged(() => Account);
            }
        }
        /// <summary>
        /// 用户名
        /// </summary>
        private string _UserName;
        /// <summary>
        /// 用户名
        /// </summary>
        public string UserName
        {
            get { return _UserName; }
            set
            {
                _UserName = value;
                RaisePropertyChanged(() => UserName);
            }
        }
        /// <summary>
        /// 密码
        /// </summary>
        private string _Password;
        /// <summary>
        /// 密码
        /// </summary>
        public string Password
        {
            get { return _Password; }
            set
            {
                _Password = value;
                RaisePropertyChanged(() => Password);
            }
        }
        /// <summary>
        /// 角色
        /// </summary>
        private string _Role;
        /// <summary>
        /// 角色码
        /// </summary>
        public string Role
        {
            get { return _Role; }
            set
            {
                _Role = value;
                RaisePropertyChanged(() => Role);
            }
        }

        /// <summary>
        /// 角色名
        /// </summary>
        public string RoleName
        {
            get
            {

                if (_Role == "system")
                {
                    return "管理员";
                }
                return "普通用户";
            }
        }
    }
}
